﻿namespace Dyao.Book.Core
{
    public class BoolDescriptionValueFormatter : IAdditionDataValueFormatter
    {
        private string _trueVaue;

        private string _falseValue;

        public BoolDescriptionValueFormatter(string trueValue, string falseValue)
        {
            _trueVaue = trueValue;
            _falseValue = falseValue;
        }

        public object Format(object value)
        {
            if (value == null) return string.Empty;
            var boolValue = (bool)value;

            return boolValue ? _trueVaue : _falseValue;
        }
    }
}
